///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct  8 2012)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////

#include "SmegEditor_gui.h"

///////////////////////////////////////////////////////////////////////////

SmegEditorFrameGUI::SmegEditorFrameGUI( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	
	m_menuBar = new wxMenuBar( 0 );
	m_fileMenu = new wxMenu();
	wxMenuItem* m_newProjectMenuItem;
	m_newProjectMenuItem = new wxMenuItem( m_fileMenu, wxID_NEW, wxString( wxT("New Project") ) + wxT('\t') + wxT("CTRL+N"), wxEmptyString, wxITEM_NORMAL );
	m_fileMenu->Append( m_newProjectMenuItem );
	
	wxMenuItem* m_openProjectMenuItem;
	m_openProjectMenuItem = new wxMenuItem( m_fileMenu, wxID_OPEN, wxString( wxT("Open Project ...") ) + wxT('\t') + wxT("CTRL+O"), wxEmptyString, wxITEM_NORMAL );
	m_fileMenu->Append( m_openProjectMenuItem );
	
	wxMenuItem* m_saveProjectMenuItem;
	m_saveProjectMenuItem = new wxMenuItem( m_fileMenu, wxID_SAVE, wxString( wxT("Save Project ...") ) + wxT('\t') + wxT("CTRL+S"), wxEmptyString, wxITEM_NORMAL );
	m_fileMenu->Append( m_saveProjectMenuItem );
	
	wxMenuItem* m_saveProjectAsMenuItem;
	m_saveProjectAsMenuItem = new wxMenuItem( m_fileMenu, wxID_SAVEAS, wxString( wxT("Save Project As ...") ) + wxT('\t') + wxT("CTRL+SHIFT+S"), wxEmptyString, wxITEM_NORMAL );
	m_fileMenu->Append( m_saveProjectAsMenuItem );
	
	m_fileMenu->AppendSeparator();
	
	wxMenuItem* m_quitMenuItem;
	m_quitMenuItem = new wxMenuItem( m_fileMenu, wxID_EXIT, wxString( wxT("Quit") ) + wxT('\t') + wxT("CTRL+W"), wxEmptyString, wxITEM_NORMAL );
	m_fileMenu->Append( m_quitMenuItem );
	
	m_menuBar->Append( m_fileMenu, wxT("&File") ); 
	
	m_editMenu = new wxMenu();
	wxMenuItem* m_undoMenuItem;
	m_undoMenuItem = new wxMenuItem( m_editMenu, wxID_ANY, wxString( wxT("Undo") ) + wxT('\t') + wxT("CTRL+Z"), wxEmptyString, wxITEM_NORMAL );
	m_editMenu->Append( m_undoMenuItem );
	m_undoMenuItem->Enable( false );
	
	wxMenuItem* m_redoMenuItem;
	m_redoMenuItem = new wxMenuItem( m_editMenu, wxID_ANY, wxString( wxT("Redo") ) + wxT('\t') + wxT("CTRL+Y"), wxEmptyString, wxITEM_NORMAL );
	m_editMenu->Append( m_redoMenuItem );
	m_redoMenuItem->Enable( false );
	
	m_editMenu->AppendSeparator();
	
	wxMenuItem* m_copyMenuItem;
	m_copyMenuItem = new wxMenuItem( m_editMenu, wxID_ANY, wxString( wxT("Copy") ) + wxT('\t') + wxT("CTRL+C"), wxEmptyString, wxITEM_NORMAL );
	m_editMenu->Append( m_copyMenuItem );
	
	wxMenuItem* m_cutMenuItem;
	m_cutMenuItem = new wxMenuItem( m_editMenu, wxID_ANY, wxString( wxT("Cut") ) + wxT('\t') + wxT("CTRL+X"), wxEmptyString, wxITEM_NORMAL );
	m_editMenu->Append( m_cutMenuItem );
	
	wxMenuItem* m_pasteMenuItem;
	m_pasteMenuItem = new wxMenuItem( m_editMenu, wxID_ANY, wxString( wxT("Paste") ) + wxT('\t') + wxT("CTRL+V"), wxEmptyString, wxITEM_NORMAL );
	m_editMenu->Append( m_pasteMenuItem );
	
	m_removeItemMenuItem = new wxMenuItem( m_editMenu, wxID_ANY, wxString( wxT("Remove") ) + wxT('\t') + wxT("DEL"), wxEmptyString, wxITEM_NORMAL );
	m_editMenu->Append( m_removeItemMenuItem );
	
	m_editMenu->AppendSeparator();
	
	m_addGroupMenuItem = new wxMenuItem( m_editMenu, wxID_ANY, wxString( wxT("Add group") ) , wxEmptyString, wxITEM_NORMAL );
	m_editMenu->Append( m_addGroupMenuItem );
	
	m_randomPositionMenuItem = new wxMenuItem( m_editMenu, wxID_ANY, wxString( wxT("Random Position") ) , wxEmptyString, wxITEM_CHECK );
	m_editMenu->Append( m_randomPositionMenuItem );
	
	m_menuBar->Append( m_editMenu, wxT("&Edit") ); 
	
	m_helpMenu = new wxMenu();
	wxMenuItem* m_aboutMenuItem;
	m_aboutMenuItem = new wxMenuItem( m_helpMenu, wxID_ABOUT, wxString( wxT("About") ) , wxEmptyString, wxITEM_NORMAL );
	m_helpMenu->Append( m_aboutMenuItem );
	
	m_menuBar->Append( m_helpMenu, wxT("&Help") ); 
	
	this->SetMenuBar( m_menuBar );
	
	wxBoxSizer* m_mainLayout;
	m_mainLayout = new wxBoxSizer( wxHORIZONTAL );
	
	m_leftPanel = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	m_leftPanel->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT ) );
	m_leftPanel->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVECAPTION ) );
	
	wxBoxSizer* m_leftLayout;
	m_leftLayout = new wxBoxSizer( wxVERTICAL );
	
	m_projectLabel = new wxStaticText( m_leftPanel, wxID_ANY, wxT("Project"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT );
	m_projectLabel->Wrap( -1 );
	m_projectLabel->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) );
	m_projectLabel->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) );
	m_projectLabel->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVECAPTION ) );
	
	m_leftLayout->Add( m_projectLabel, 0, wxALL|wxEXPAND, 2 );
	
	m_projectTreeCtrl = new wxTreeCtrl( m_leftPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTR_DEFAULT_STYLE|wxTR_MULTIPLE );
	m_leftLayout->Add( m_projectTreeCtrl, 1, wxALL|wxEXPAND, 0 );
	
	m_componentsLabel = new wxStaticText( m_leftPanel, wxID_ANY, wxT("Components"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT );
	m_componentsLabel->Wrap( -1 );
	m_componentsLabel->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) );
	m_componentsLabel->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) );
	m_componentsLabel->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVECAPTION ) );
	
	m_leftLayout->Add( m_componentsLabel, 0, wxALL|wxEXPAND, 2 );
	
	m_componentsTreeCtrl = new wxTreeCtrl( m_leftPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTR_DEFAULT_STYLE );
	m_leftLayout->Add( m_componentsTreeCtrl, 1, wxALL|wxEXPAND, 0 );
	
	
	m_leftPanel->SetSizer( m_leftLayout );
	m_leftPanel->Layout();
	m_leftLayout->Fit( m_leftPanel );
	m_mainLayout->Add( m_leftPanel, 1, wxALL|wxEXPAND, 0 );
	
	m_canvasLayout = new wxBoxSizer( wxHORIZONTAL );
	
	
	m_mainLayout->Add( m_canvasLayout, 4, wxEXPAND, 0 );
	
	m_rightPanel = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	m_rightPanel->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVECAPTION ) );
	
	m_rightLayout = new wxBoxSizer( wxVERTICAL );
	
	m_propertyLabel = new wxStaticText( m_rightPanel, wxID_ANY, wxT("Property"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT );
	m_propertyLabel->Wrap( -1 );
	m_propertyLabel->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) );
	m_propertyLabel->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) );
	m_propertyLabel->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVECAPTION ) );
	
	m_rightLayout->Add( m_propertyLabel, 0, wxALL|wxEXPAND, 2 );
	
	
	m_rightPanel->SetSizer( m_rightLayout );
	m_rightPanel->Layout();
	m_rightLayout->Fit( m_rightPanel );
	m_mainLayout->Add( m_rightPanel, 1, wxEXPAND | wxALL, 0 );
	
	
	this->SetSizer( m_mainLayout );
	this->Layout();
	m_statusBar = this->CreateStatusBar( 1, wxST_SIZEGRIP, wxID_ANY );
	m_projectPopupMenu = new wxMenu();
	m_removeItemPopupMenu = new wxMenuItem( m_projectPopupMenu, wxID_ANY, wxString( wxT("Remove") ) , wxEmptyString, wxITEM_NORMAL );
	m_projectPopupMenu->Append( m_removeItemPopupMenu );
	
	m_addGroupPopupMenu = new wxMenuItem( m_projectPopupMenu, wxID_ANY, wxString( wxT("Add group") ) , wxEmptyString, wxITEM_NORMAL );
	m_projectPopupMenu->Append( m_addGroupPopupMenu );
	
	this->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( SmegEditorFrameGUI::SmegEditorFrameGUIOnContextMenu ), NULL, this ); 
	
	
	this->Centre( wxBOTH );
	
	// Connect Events
	this->Connect( m_newProjectMenuItem->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SmegEditorFrameGUI::OnNewProject ) );
	this->Connect( m_openProjectMenuItem->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SmegEditorFrameGUI::OnOpenProject ) );
	this->Connect( m_saveProjectMenuItem->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SmegEditorFrameGUI::OnSaveProject ) );
	this->Connect( m_saveProjectAsMenuItem->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SmegEditorFrameGUI::OnSaveProjectAs ) );
	this->Connect( m_quitMenuItem->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SmegEditorFrameGUI::OnQuit ) );
	this->Connect( m_copyMenuItem->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SmegEditorFrameGUI::OnCopySelected ) );
	this->Connect( m_cutMenuItem->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SmegEditorFrameGUI::OnCutSelected ) );
	this->Connect( m_pasteMenuItem->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SmegEditorFrameGUI::OnPasteSelected ) );
	this->Connect( m_removeItemMenuItem->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SmegEditorFrameGUI::OnProjectItemRemove ) );
	this->Connect( m_addGroupMenuItem->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SmegEditorFrameGUI::OnProjectItemAddGroup ) );
	this->Connect( m_aboutMenuItem->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SmegEditorFrameGUI::OnAbout ) );
	m_projectTreeCtrl->Connect( wxEVT_COMMAND_TREE_BEGIN_DRAG, wxTreeEventHandler( SmegEditorFrameGUI::OnProjectItemBeginDrag ), NULL, this );
	m_projectTreeCtrl->Connect( wxEVT_COMMAND_TREE_END_DRAG, wxTreeEventHandler( SmegEditorFrameGUI::OnProjectItemEndDrag ), NULL, this );
	m_projectTreeCtrl->Connect( wxEVT_COMMAND_TREE_ITEM_MENU, wxTreeEventHandler( SmegEditorFrameGUI::OnProjectItemSubMenu ), NULL, this );
	m_projectTreeCtrl->Connect( wxEVT_COMMAND_TREE_SEL_CHANGED, wxTreeEventHandler( SmegEditorFrameGUI::OnProjectItemSelected ), NULL, this );
	m_componentsTreeCtrl->Connect( wxEVT_COMMAND_TREE_ITEM_ACTIVATED, wxTreeEventHandler( SmegEditorFrameGUI::OnComponentSelected ), NULL, this );
	this->Connect( m_removeItemPopupMenu->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SmegEditorFrameGUI::OnProjectItemRemove ) );
	this->Connect( m_addGroupPopupMenu->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SmegEditorFrameGUI::OnProjectItemAddGroup ) );
}

SmegEditorFrameGUI::~SmegEditorFrameGUI()
{
	// Disconnect Events
	this->Disconnect( wxID_NEW, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SmegEditorFrameGUI::OnNewProject ) );
	this->Disconnect( wxID_OPEN, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SmegEditorFrameGUI::OnOpenProject ) );
	this->Disconnect( wxID_SAVE, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SmegEditorFrameGUI::OnSaveProject ) );
	this->Disconnect( wxID_SAVEAS, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SmegEditorFrameGUI::OnSaveProjectAs ) );
	this->Disconnect( wxID_EXIT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SmegEditorFrameGUI::OnQuit ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SmegEditorFrameGUI::OnCopySelected ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SmegEditorFrameGUI::OnCutSelected ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SmegEditorFrameGUI::OnPasteSelected ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SmegEditorFrameGUI::OnProjectItemRemove ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SmegEditorFrameGUI::OnProjectItemAddGroup ) );
	this->Disconnect( wxID_ABOUT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SmegEditorFrameGUI::OnAbout ) );
	m_projectTreeCtrl->Disconnect( wxEVT_COMMAND_TREE_BEGIN_DRAG, wxTreeEventHandler( SmegEditorFrameGUI::OnProjectItemBeginDrag ), NULL, this );
	m_projectTreeCtrl->Disconnect( wxEVT_COMMAND_TREE_END_DRAG, wxTreeEventHandler( SmegEditorFrameGUI::OnProjectItemEndDrag ), NULL, this );
	m_projectTreeCtrl->Disconnect( wxEVT_COMMAND_TREE_ITEM_MENU, wxTreeEventHandler( SmegEditorFrameGUI::OnProjectItemSubMenu ), NULL, this );
	m_projectTreeCtrl->Disconnect( wxEVT_COMMAND_TREE_SEL_CHANGED, wxTreeEventHandler( SmegEditorFrameGUI::OnProjectItemSelected ), NULL, this );
	m_componentsTreeCtrl->Disconnect( wxEVT_COMMAND_TREE_ITEM_ACTIVATED, wxTreeEventHandler( SmegEditorFrameGUI::OnComponentSelected ), NULL, this );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SmegEditorFrameGUI::OnProjectItemRemove ) );
	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SmegEditorFrameGUI::OnProjectItemAddGroup ) );
	
	delete m_projectPopupMenu; 
}

ConvexHullCreatorDialogGUI::ConvexHullCreatorDialogGUI( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxSize( 700,480 ), wxDefaultSize );
	
	wxBoxSizer* m_mainLayout;
	m_mainLayout = new wxBoxSizer( wxHORIZONTAL );
	
	m_canvasLayout = new wxBoxSizer( wxVERTICAL );
	
	
	m_mainLayout->Add( m_canvasLayout, 3, wxEXPAND, 0 );
	
	m_rightPanel = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxBoxSizer* m_rightLayout;
	m_rightLayout = new wxBoxSizer( wxVERTICAL );
	
	wxBoxSizer* m_buttons;
	m_buttons = new wxBoxSizer( wxHORIZONTAL );
	
	m_validateConvexHull = new wxButton( m_rightPanel, wxVALIDATE_CONVEX_HULL, wxT("Validate"), wxDefaultPosition, wxDefaultSize, 0 );
	m_buttons->Add( m_validateConvexHull, 1, wxALL|wxEXPAND, 5 );
	
	m_cancelButton = new wxButton( m_rightPanel, wxCANCEL_CONVEX_HULL, wxT("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
	m_buttons->Add( m_cancelButton, 1, wxALL|wxEXPAND, 5 );
	
	
	m_rightLayout->Add( m_buttons, 0, wxEXPAND, 5 );
	
	wxBoxSizer* m_numVerticesLayout;
	m_numVerticesLayout = new wxBoxSizer( wxHORIZONTAL );
	
	m_numVerticesLabel = new wxStaticText( m_rightPanel, wxID_ANY, wxT("Num Vertices :"), wxDefaultPosition, wxDefaultSize, 0 );
	m_numVerticesLabel->Wrap( -1 );
	m_numVerticesLayout->Add( m_numVerticesLabel, 2, wxALIGN_CENTER|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 7 );
	
	m_numVerticesSpin = new wxSpinCtrl( m_rightPanel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 3, 999, 3 );
	m_numVerticesLayout->Add( m_numVerticesSpin, 3, wxALL|wxEXPAND, 5 );
	
	
	m_rightLayout->Add( m_numVerticesLayout, 0, wxEXPAND, 5 );
	
	m_multiplierLayout = new wxBoxSizer( wxHORIZONTAL );
	
	m_sizeMultiplierLabel = new wxStaticText( m_rightPanel, wxID_ANY, wxT("Size Multiplier :"), wxDefaultPosition, wxDefaultSize, 0 );
	m_sizeMultiplierLabel->Wrap( -1 );
	m_multiplierLayout->Add( m_sizeMultiplierLabel, 2, wxALL|wxEXPAND, 5 );
	
	
	m_rightLayout->Add( m_multiplierLayout, 0, wxEXPAND, 5 );
	
	m_propertyPanel = new wxPanel( m_rightPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	m_propertyLayout = new wxBoxSizer( wxVERTICAL );
	
	
	m_propertyPanel->SetSizer( m_propertyLayout );
	m_propertyPanel->Layout();
	m_propertyLayout->Fit( m_propertyPanel );
	m_rightLayout->Add( m_propertyPanel, 1, wxEXPAND | wxALL, 0 );
	
	
	m_rightPanel->SetSizer( m_rightLayout );
	m_rightPanel->Layout();
	m_rightLayout->Fit( m_rightPanel );
	m_mainLayout->Add( m_rightPanel, 1, wxEXPAND | wxALL, 0 );
	
	
	this->SetSizer( m_mainLayout );
	this->Layout();
	
	this->Centre( wxBOTH );
	
	// Connect Events
	m_validateConvexHull->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ConvexHullCreatorDialogGUI::OnValidateConvexHull ), NULL, this );
	m_cancelButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ConvexHullCreatorDialogGUI::OnCancelConvexHull ), NULL, this );
	m_numVerticesSpin->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( ConvexHullCreatorDialogGUI::OnNumVerticesChanged ), NULL, this );
}

ConvexHullCreatorDialogGUI::~ConvexHullCreatorDialogGUI()
{
	// Disconnect Events
	m_validateConvexHull->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ConvexHullCreatorDialogGUI::OnValidateConvexHull ), NULL, this );
	m_cancelButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ConvexHullCreatorDialogGUI::OnCancelConvexHull ), NULL, this );
	m_numVerticesSpin->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( ConvexHullCreatorDialogGUI::OnNumVerticesChanged ), NULL, this );
	
}

BaseEntityChooserDialogGUI::BaseEntityChooserDialogGUI( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxSize( 200,300 ), wxDefaultSize );
	
	wxBoxSizer* m_mainLayout;
	m_mainLayout = new wxBoxSizer( wxVERTICAL );
	
	m_BaseEntityList = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); 
	m_mainLayout->Add( m_BaseEntityList, 10, wxALL|wxEXPAND, 1 );
	
	wxBoxSizer* m_ButtonLayout;
	m_ButtonLayout = new wxBoxSizer( wxHORIZONTAL );
	
	m_ValidateButton = new wxButton( this, wxVALIDATE_BASE_ENTITY, wxT("Validate"), wxDefaultPosition, wxDefaultSize, 0 );
	m_ButtonLayout->Add( m_ValidateButton, 1, wxALL|wxEXPAND, 1 );
	
	m_CancelButton = new wxButton( this, wxCANCEL_BASE_ENTITY, wxT("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
	m_ButtonLayout->Add( m_CancelButton, 1, wxALL|wxEXPAND, 1 );
	
	
	m_mainLayout->Add( m_ButtonLayout, 1, wxEXPAND, 0 );
	
	
	this->SetSizer( m_mainLayout );
	this->Layout();
	
	this->Centre( wxBOTH );
	
	// Connect Events
	m_BaseEntityList->Connect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( BaseEntityChooserDialogGUI::OnChooseBaseEntity ), NULL, this );
	m_ValidateButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BaseEntityChooserDialogGUI::OnValidateBaseEntity ), NULL, this );
	m_CancelButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BaseEntityChooserDialogGUI::OnCancelBaseEntity ), NULL, this );
}

BaseEntityChooserDialogGUI::~BaseEntityChooserDialogGUI()
{
	// Disconnect Events
	m_BaseEntityList->Disconnect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( BaseEntityChooserDialogGUI::OnChooseBaseEntity ), NULL, this );
	m_ValidateButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BaseEntityChooserDialogGUI::OnValidateBaseEntity ), NULL, this );
	m_CancelButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BaseEntityChooserDialogGUI::OnCancelBaseEntity ), NULL, this );
	
}
